<?php

namespace app\business\controller;

use think\Controller;
use Util\SysDb;
use think\Db;
class Flow extends Controller 
{
    public function flowlist()
    {
        $id = trim(input('param.id'));
        $page = trim(input('param.pageNo'));
        $limit= trim(input('param.pageSize'));
        $type=trim(input('param.type'));
        $this->db = new SysDb();
        // $count = $this->db->table('newslist')->count();
        $tol = (intval($page) - 1) * $limit;
        // ->where('type', $type)
         $list =DB::name("bus_flow")->order("create_time desc")->where('bus_id', $id)->limit($tol, $limit)->select();
        // $list=$this->db->table('order_info')->where(['bus_id' =>$id])->lists();
        $count = $this->db->table('bus_flow')->where(['bus_id' => $id]) ->count();
        $data=array();
        array_push($data,$list);
        array_push($data,$count);
        exit(json_encode(['code' => 1, 'message' => 'succ', "result" => $data]));
    }
}